﻿<html DIR="LTR" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" />
    <META NAME="save" CONTENT="history" />
    <title>Método getReference (SQLServerDataSource)</title>
    
    <link rel="stylesheet" type="text/css" href="../local/Classic.css">
      
    </link>
    
    <script src="../local/script.js">
      
    </script><script src="../local/script_main.js">&amp;nbsp;</script>
  </head>
  <body>
    <!--Topic built:04/01/2010 05:03:30-->

    
    
    
    
    
    
    
    
    
    <div id="header">
      <table width="100%" id="topTable"><tr>
          <td align="left">
            <span id="headerBold">Método getReference (SQLServerDataSource)</span>
          </td>
          <td align="right">
            
          </td>
        </tr></table>
      
      
      
    </div>
    <div id="mainSection">
      
        
        
    <font color="DarkGray">
      
    </font>
    <p />
    
    <p />
  
        <div id="introductionSection" class="section">
    <p>Retorna uma referência ao objeto <a href="097434fd-2b74-411c-a5ed-eba04481dde5.htm">SQLServerDataSource</a>.</p>
  </div><h1 class="heading">Sintaxe</h1><div id="syntaxSection" class="section"><div class="sampleCode"><span codeLanguage="other"><pre>
public javax.naming.Reference <b>getReference</b>()</pre></span></div></div><h1 class="heading">Valor de retorno</h1><div id="returnValueSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">Um objeto <b>Reference</b>.</p>
    </content>
  </div><h1 class="heading">Comentários</h1><div id="remarksSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">Esse método <b>getReference</b> é especificado pelo método <b>getReference</b> na interface javax.naming.Referenceable.</p>
      <p xmlns="">Antes do SQL Server JDBC Driver 3.0, se SQLServerDataSource.setTrustStorePassword fosse chamado em um objeto SQLServerDataSource, a senha estaria presente no objeto retornado pelo SQLServerDataSource.getReference, permitindo que o objeto fosse usado para fazer conexões adicionais. No JDBC Driver 3.0, será necessário definir a senha no objeto retornado pelo SQLServerDataSource.getReference antes de fazer conexões com o objeto.</p>
      <p xmlns="">Além disso, se definir SQLServerDataSource.setTrustStorePassword antes de associar as propriedades de fonte de dados, você deverá chamar SQLServerDataSource.setTrustStorePassword antes de estabelecer a conexão. Por exemplo,</p>
      <div class="sampleCode" xmlns=""><span codeLanguage="other"><pre>ctx = new InitialContext(System.getProperties());

SQLServerDataSource ds1 = (SQLServerDataSource) ctx.lookup(jndiName);

ds1.setTrustStorePassword("XXXXX");
Connection con = ds1.getConnection("user", "XXXXXX");

ctx.rebind(jndiName, ds1);
SQLServerDataSource ds2 = (SQLServerDataSource) ctx.lookup(jndiName);
ds2.setTrustStorePassword("XXXXX");   // reset the truststore password
con = ds2.getConnection("user", "XXXXXX");   // provide userid and password again</pre></span></div>
    </content>
  </div><span id="seeAlsoSpan"><h1 class="heading">Consulte também</h1></span><div id="seeAlsoSection" class="section" name="collapseableSection"><a href="097434fd-2b74-411c-a5ed-eba04481dde5.htm">Classe SQLServerDataSource</a><br /><a href="7e749bc5-d765-4864-be2b-7822d4c20c09.htm">Membros de SQLServerDataSource</a><br /><br /></div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/><tool:tip element="roleInfoSpan" avoidmouse="false"/>
		<![endif]-->
      <div id="footer" class="section">
        
		<hr />
		
		<span id="fb" class="feedbackcss">
			
			
		</span>
		
		<a href="9bad553b-9e70-4696-8499-2e35f772a1e0.htm">
			
			© 2010 Microsoft Corporation. Todos os direitos reservados.
		</a>
 	
	
      </div>
    </div>
  </body>
</html>